#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;

class Shape
{
protected:
    int x, y;
public:
    virtual ~Shape() {}
    virtual void draw() = 0;
};

class Circle: public Shape
{
private:
    int radius;
public:
    Circle(int x, int y, int radius)
    {
        this->x = x;
        this->y = y;
        this->radius = radius;
    }
    void draw()
    {
        cout << "Draw a circle >>> x:" << x << ",y:" << y << ",radius:" << radius << endl;
    }
};

class Square: public Shape
{
private:
    int length;
public:
    Square(int x, int y, int length)
    {
        this->x = x;
        this->y = y;
        this->length = length;
    }
    void draw()
    {
        cout << "Draw a square >>> x:" << x << ",y:" << y << ",length:" << length << endl;
    }
};

class Triangle: public Shape
{
private:
    int high, width;
public:
    Triangle(int x, int y, int high, int width)
    {
        this->x = x;
        this->y = y;
        this->high = high;
        this->width = width;
    }
    void draw()
    {
        cout << "Draw a triangle >>> x:" << x << ",y:" << y << ",high:" << high << ",width:" << width << endl;
    }
};

class Rectangle: public Shape
{
private:
    int length, width;
public:
    Rectangle(int x, int y, int length, int width)
    {
        this->x = x;
        this->y = y;
        this->length = length;
        this->width = width;
    }
    void draw()
    {
        cout << "Draw a rectangle >>> x:" << x << ",y:" << y << ",length:" << length << ",width:" << width << endl;
    }
};

void drawAllShapes(vector<Shape*> shapes)
{
    for(size_t i=0; i < shapes.size(); i++)
        shapes[i]->draw();
}

int main()
{
    vector<Shape*> shapes;
    Shape* circle = new Circle(2,5,100);
    shapes.push_back(circle);
    Shape* square = new Square(10,21,50);
    shapes.push_back(square);
    Shape* triangle = new Triangle(50, 0, 30, 30);
    shapes.push_back(triangle);
    Shape* rectangle = new Rectangle(20,5,100,80);
    shapes.push_back(rectangle);
    drawAllShapes(shapes);
    return 0;
}
